package com.fowo.api.service.handleWork;

import com.fowo.api.entity.StockIn;
import com.fowo.api.mapper.StockInMapper;
import com.fowo.api.model.stock.in.StockInApplyInBatchStorageAction;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import javax.annotation.Resource;
import java.util.List;

@Component
public class StockInApplyInBatchStorage implements StockInApplyInBatchStorageAction {

    @Resource
    private StockInMapper stockInMapper;
    @Resource
    private  StockInApplyInStorage StockInApplyInStorage;
    @Override
    public void run(List<Long> idList) throws Exception {
        for(Long id : idList){
            StockInApplyInStorage.run(id);
//            StockIn byId = stockInMapper.selectById(id);
//            Assert.notNull(byId,"没有找到这个入库单");
//            Assert.isTrue(byId.getStatus().equals("0"),"违规操作!");
//            byId.setStatus("1");
//            stockInMapper.updateById(byId);
        }
    }
}
